package com.qfedu.mall.api.controller;

import com.qfedu.mall.common.vo.ResultVO;
import com.qfedu.mall.service.VideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dyw
 * @Date 2021年12月08日 19:20
 */
@CrossOrigin
@RestController
@RequestMapping("/video")
@Api(value = "提供视频信息相关接口",tags = "视频管理")
public class VideoController {

    @Autowired
    private VideoService videoService;

    @GetMapping("/getVideo")
    @ApiOperation("查询直播视频")
    @ApiImplicitParam(dataType = "Integer",name = "videoId", value = "视频id",required = true)
    public ResultVO getAllVideo(Integer videoId){
        System.out.println("videoId:" + videoId);
        ResultVO resultVO = videoService.getAllVideo();
        return resultVO;
    }


    @GetMapping("/getLiveCover")
    @ApiOperation("查询直播封面")
    public ResultVO getLiveCover(){
        ResultVO resultVO = videoService.getLiveCover();

        return resultVO;
    }
    @GetMapping("/getVideoAll")
    @ApiOperation("查询直播视频")
//    @ApiImplicitParam(dataType = "Integer",name = "videoId", value = "视频id",required = true)
    public ResultVO getAllVideo(){
//        System.out.println("videoId:" + videoId);
        ResultVO resultVO = videoService.getAllVideo();
        return resultVO;
    }
}
